package com.xmtlxx.common.config;

import lombok.Data;
import lombok.Getter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 读取项目相关配置
 *
 * @author xmtlxx
 */

@Data
@Component
@ConfigurationProperties(prefix = "xmtlxx")
public class XmtlxxConfig {

    /**
     * 项目名称
     */
    private String name;

    /**
     * 版本
     */
    private String version;

    /**
     * 版权年份
     */
    private String copyrightYear;

    /**
     * 实例演示开关
     */
    private boolean demoEnabled;

    /**
     * 缓存懒加载
     */
    private boolean cacheLazy;

    /**
     * 文件临时目录
     */
    @Getter
    private static String filePath;

    public void setFilePath(String filePath) {
        XmtlxxConfig.filePath = filePath;
    }

    @Getter
    private static String aliyunSmsEndpoint;

    public void setAliyunSmsEndpoint(String aliyunSmsEndpoint){

        XmtlxxConfig.aliyunSmsEndpoint = aliyunSmsEndpoint;}

    @Getter
    private static String protocol;

    public void setProtocol(String protocol){

        XmtlxxConfig.protocol = protocol;}

    @Getter
    private static Boolean debugEvn;

    public void setDebugEvn(Boolean debugEvn){ XmtlxxConfig.debugEvn = debugEvn;}

    @Getter
    private static String debugPhone;

    public void setDebugPhone(String debugPhone){

        XmtlxxConfig.debugPhone = debugPhone;}

    /**
     * 获取地址开关
     */
    @Getter
    private static boolean addressEnabled;

    public void setAddressEnabled(boolean addressEnabled) {
        XmtlxxConfig.addressEnabled = addressEnabled;
    }

}
